Date : 02/26/2020

README File for replication of all figures and table reported in "Political Isolation in America" by Byungkyu Lee and Peter Bearman, _Network Science_, 2020, forthcoming (https://doi.org/10.1017/nws.2020.9). 

This file contains Stata Do files and R codes to reproduce all figures and tables appeared in the main text as well as Appendix. 

## Data
The original data set are not included here -- which are all publicly available --  but can be downloaded at:

1) GSS - Smith, Tom W., Peter Marsden, Michael Hout, and Jibum Kim. General Social Surveys, 1972–2016 R4 : http://www3.norc.org/GSS+Website/ (last accessed on 11 September 2018).
-- `GSS7216_R4.dta` contains the 1985, 1987, and 2004 GSS data
-- `GSS_panel06w123_R6.dta` contains the 2010 GSS data

2) ANES - American National Election Studies. Available from: http://www.electionstudies.org/index.html (last accessed on 14 March 2014).
-- `ANES2000TS.dta` contains the 2000 ANES data
-- `ANES2006.dta` + `ANES2004TS.dta` contains the 2006 ANES pilot study.
-- `anes2008_2009panel_dataset.dta` contains the 2008-09 ANES panel data.

3) CNES - Crossnational National Election Studies. Available from: https://www.icpsr.umich.edu/icpsrweb/ICPSR/studies/6541 (last accessed on 06 October 2018).
-- `CNES_1.dta` contains the 1992 CNES data

4) TESS - Time Sharing Experiment For Social Sciences. Available from: https://www.tessexperiments.org/ (last accessed on 02 February 2020).
(The original files are SPSS files, but I used `rio` package in R to convert them to Stata files)
-- `TESS2_023_Brashears_Client.dta` (http://www.tessexperiments.org/data/zip/brashears772.zip)
-- `TESS3_214_Lee_Combined_Final_Data.dta` and `TESS3_214_Lee_Extra_Interviews.dta` (https://osf.io/6esdw/)

I include one Stata data file (`tess_cleaned.dta`) that was generated by running `PI_meta_process_data.do`. You can use this one stata file to generate all figures and tables reported in the paper. I also include one csv file (`tess_coding_matched.csv`) containing text coding results that are generated by the first author and a graduate student RA as well as a file that is used to link text coding to the original survey (`textcoding_idmatch.csv`). Finally, I include `coding_category_match.csv` that synthesize different coding schemes across three different papers (also see Table A3 in Appendix A).

If you set up the working directory containing the data file in your computer in the following main stata do files and R codes, then you can reproduce all figures and tables by running the corresponding Stata do-file and R code described in `PI_meta_statistical_models.do` and `PI_meta_figures.R`. 

## Program Version Information : 
-- Stata 14 SE version for all analysis 
-- R 3.5.3 for all analysis

If you have any question on these files or fail to reproduce any of figures or tables, then please direct your correspondence to Byungkyu Lee (bklee009@gmail.com). 

